<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>QuantumLibrary: /bb/mbigc/mbig5696/git/quantum_external/src/quantum_task_queue.h Source File</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">QuantumLibrary
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('d5/dd2/quantum__task__queue_8h_source.html','../../');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">quantum_task_queue.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">** Copyright 2018 Bloomberg Finance L.P.</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">**</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">** Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">** you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">** You may obtain a copy of the License at</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">**</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">**     http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">**</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">** Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">** distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">** See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">** limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">*/</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#ifndef BLOOMBERG_QUANTUM_TASK_QUEUE_H</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#define BLOOMBERG_QUANTUM_TASK_QUEUE_H</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#include &lt;list&gt;</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &lt;atomic&gt;</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#include &lt;functional&gt;</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="preprocessor">#include &lt;algorithm&gt;</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#include &lt;mutex&gt;</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#include &lt;condition_variable&gt;</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#include &lt;thread&gt;</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#include &lt;pthread.h&gt;</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#include &lt;iostream&gt;</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#include &lt;quantum/interface/quantum_itask_continuation.h&gt;</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#include &lt;quantum/interface/quantum_iterminate.h&gt;</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#include &lt;quantum/interface/quantum_iqueue.h&gt;</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#include &lt;quantum/quantum_spinlock.h&gt;</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#include &lt;quantum/quantum_yielding_thread.h&gt;</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#include &lt;quantum/quantum_queue_statistics.h&gt;</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#include &lt;quantum/quantum_configuration.h&gt;</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="keyword">namespace </span><a class="code" href="../../d6/db9/namespaceBloomberg.html">Bloomberg</a> {</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="keyword">namespace </span>quantum {</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="comment">//==============================================================================================</span></div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="comment">//                                 class TaskQueue</span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="comment">//==============================================================================================</span></div><div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html">   45</a></span>&#160;<span class="comment"></span><span class="keyword">class </span><a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html">TaskQueue</a> : <span class="keyword">public</span> <a class="code" href="../../d2/db0/structBloomberg_1_1quantum_1_1IQueue.html">IQueue</a></div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;{</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#a1d5ae5e8b380c3b88f09f64ebce2e411">   48</a></span>&#160;    <span class="keyword">using</span> <a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#a1d5ae5e8b380c3b88f09f64ebce2e411">TaskList</a> = std::list&lt;Task::Ptr, QueueListAllocator&gt;;</div><div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#a2cc96b016e5f92f1f6e77f9bd0cb6783">   49</a></span>&#160;    <span class="keyword">using</span> <a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#a2cc96b016e5f92f1f6e77f9bd0cb6783">TaskListIter</a> = TaskList::iterator;</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    </div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    <a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#a062eb69d9f40611e0240b17c9c753b95">TaskQueue</a>();</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    </div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    <span class="keyword">explicit</span> <a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#a062eb69d9f40611e0240b17c9c753b95">TaskQueue</a>(<span class="keyword">const</span> <a class="code" href="../../db/dda/classBloomberg_1_1quantum_1_1Configuration.html">Configuration</a>&amp; config);</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    </div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    <a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#a062eb69d9f40611e0240b17c9c753b95">TaskQueue</a>(<span class="keyword">const</span> <a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html">TaskQueue</a>&amp; other);</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    </div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    <a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#a062eb69d9f40611e0240b17c9c753b95">TaskQueue</a>(<a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html">TaskQueue</a>&amp;&amp; other) = <span class="keywordflow">default</span>;</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    </div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    <a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#ab139dd2134e5bacecc8e282ac63010fb">~TaskQueue</a>();</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    </div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#a538a6332f83626076d5850438bbcdcc9">pinToCore</a>(<span class="keywordtype">int</span> coreId) <span class="keyword">final</span>;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    </div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#a0b0a30fdf109f7b8ec549c194a6a0701">run</a>() final;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    </div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#abf230e9bdc7bf07033f5afbb7a2f3cc3">enqueue</a>(<a class="code" href="../../df/daf/structBloomberg_1_1quantum_1_1ITask.html">ITask</a>::<a class="code" href="../../d2/db0/structBloomberg_1_1quantum_1_1IQueue.html#ab4c4a3db733a93ad451c9dc7ffe62824">Ptr</a> task) final;</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    </div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#abe66c06fdb34f0dba8863ce115ad9388">tryEnqueue</a>(<a class="code" href="../../df/daf/structBloomberg_1_1quantum_1_1ITask.html">ITask</a>::<a class="code" href="../../d2/db0/structBloomberg_1_1quantum_1_1IQueue.html#ab4c4a3db733a93ad451c9dc7ffe62824">Ptr</a> task) final;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    </div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    <a class="code" href="../../df/daf/structBloomberg_1_1quantum_1_1ITask.html">ITask</a>::<a class="code" href="../../d2/db0/structBloomberg_1_1quantum_1_1IQueue.html#ab4c4a3db733a93ad451c9dc7ffe62824">Ptr</a> <a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#a45cfdb8a415a15bdcd6e52b26c18f035">dequeue</a>(<a class="code" href="../../d8/dcc/namespacestd.html">std</a>::atomic_bool&amp; hint) final;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    </div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    <a class="code" href="../../df/daf/structBloomberg_1_1quantum_1_1ITask.html">ITask</a>::<a class="code" href="../../d2/db0/structBloomberg_1_1quantum_1_1IQueue.html#ab4c4a3db733a93ad451c9dc7ffe62824">Ptr</a> <a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#ae7120fc5642802293e0fff8de45fcfa5">tryDequeue</a>(<a class="code" href="../../d8/dcc/namespacestd.html">std</a>::atomic_bool&amp; hint) final;</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    </div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    <span class="keywordtype">size_t</span> <a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#a5307b142d43acd7adc5d6ca6dff84c27">size</a>() const final;</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    </div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#ad2942c9d04b7c1d7eed395ee8186964e">empty</a>() const final;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    </div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#addcace6a6fc8ec654f3d46c97d47e14a">terminate</a>() final;</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    </div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <a class="code" href="../../d5/de7/structBloomberg_1_1quantum_1_1IQueueStatistics.html">IQueueStatistics</a>&amp; <a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#a2fab46164ecf8aa2e847f713e0e35cdd">stats</a>() final;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    </div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    <a class="code" href="../../de/df4/namespaceSpinLock.html">SpinLock</a>&amp; <a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#adcb6d84109188e5c6152adbfe004e219">getLock</a>() final;</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    </div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#ae037a712f1c548a3fe755d3cf165142a">signalEmptyCondition</a>(<span class="keywordtype">bool</span> value) final;</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    </div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#aa95412277b5a0324549af806721fd85e">isIdle</a>() const final;</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;private:</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    <a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#a2cc96b016e5f92f1f6e77f9bd0cb6783">TaskListIter</a> advance();</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    <span class="keywordtype">void</span> doEnqueue(<a class="code" href="../../df/daf/structBloomberg_1_1quantum_1_1ITask.html">ITask</a>::<a class="code" href="../../d2/db0/structBloomberg_1_1quantum_1_1IQueue.html#ab4c4a3db733a93ad451c9dc7ffe62824">Ptr</a> task);</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    <a class="code" href="../../df/daf/structBloomberg_1_1quantum_1_1ITask.html">ITask</a>::<a class="code" href="../../d2/db0/structBloomberg_1_1quantum_1_1IQueue.html#ab4c4a3db733a93ad451c9dc7ffe62824">Ptr</a> doDequeue(<a class="code" href="../../d8/dcc/namespacestd.html">std</a>::atomic_bool&amp; hint);</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    </div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    <a class="code" href="../../d8/dcc/namespacestd.html">std</a>::shared_ptr&lt;<a class="code" href="../../d8/dcc/namespacestd.html">std</a>::thread&gt;        _thread;</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    <a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#a1d5ae5e8b380c3b88f09f64ebce2e411">TaskList</a>                            _queue;</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#a2cc96b016e5f92f1f6e77f9bd0cb6783">TaskListIter</a>                        _queueIt;</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    <a class="code" href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#a2cc96b016e5f92f1f6e77f9bd0cb6783">TaskListIter</a>                        _blockedIt;</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    mutable <a class="code" href="../../de/df4/namespaceSpinLock.html">SpinLock</a>                    _spinlock;</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    <a class="code" href="../../d8/dcc/namespacestd.html">std</a>::mutex                          _notEmptyMutex; <span class="comment">//for accessing the condition variable</span></div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    <a class="code" href="../../d8/dcc/namespacestd.html">std</a>::condition_variable             _notEmptyCond;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    <a class="code" href="../../d8/dcc/namespacestd.html">std</a>::atomic_bool                    _isEmpty;</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    <a class="code" href="../../d8/dcc/namespacestd.html">std</a>::atomic_bool                    _isInterrupted;</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <a class="code" href="../../d8/dcc/namespacestd.html">std</a>::atomic_bool                    _isIdle;</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    <a class="code" href="../../d8/dcc/namespacestd.html">std</a>::atomic_flag                    _terminated;</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    <span class="keywordtype">bool</span>                                _isAdvanced;</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    <a class="code" href="../../d1/d7b/classBloomberg_1_1quantum_1_1QueueStatistics.html">QueueStatistics</a>                     _stats;</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;};</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;}}</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;<span class="preprocessor">#include &lt;quantum/impl/quantum_task_queue_impl.h&gt;</span></div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;<span class="preprocessor">#endif //BLOOMBERG_QUANTUM_TASK_QUEUE_H</span></div><div class="ttc" id="namespaceBloomberg_html"><div class="ttname"><a href="../../d6/db9/namespaceBloomberg.html">Bloomberg</a></div><div class="ttdef"><b>Definition:</b> quantum_buffer_impl.h:22</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1TaskQueue_html_a5307b142d43acd7adc5d6ca6dff84c27"><div class="ttname"><a href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#a5307b142d43acd7adc5d6ca6dff84c27">Bloomberg::quantum::TaskQueue::size</a></div><div class="ttdeci">size_t size() const final</div><div class="ttdef"><b>Definition:</b> quantum_task_queue_impl.h:282</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1TaskQueue_html_addcace6a6fc8ec654f3d46c97d47e14a"><div class="ttname"><a href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#addcace6a6fc8ec654f3d46c97d47e14a">Bloomberg::quantum::TaskQueue::terminate</a></div><div class="ttdeci">void terminate() final</div><div class="ttdoc">Terminates the object.</div><div class="ttdef"><b>Definition:</b> quantum_task_queue_impl.h:299</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1TaskQueue_html_a1d5ae5e8b380c3b88f09f64ebce2e411"><div class="ttname"><a href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#a1d5ae5e8b380c3b88f09f64ebce2e411">Bloomberg::quantum::TaskQueue::TaskList</a></div><div class="ttdeci">std::list&lt; Task::Ptr, QueueListAllocator &gt; TaskList</div><div class="ttdef"><b>Definition:</b> quantum_task_queue.h:48</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1TaskQueue_html_ab139dd2134e5bacecc8e282ac63010fb"><div class="ttname"><a href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#ab139dd2134e5bacecc8e282ac63010fb">Bloomberg::quantum::TaskQueue::~TaskQueue</a></div><div class="ttdeci">~TaskQueue()</div><div class="ttdef"><b>Definition:</b> quantum_task_queue_impl.h:53</div></div>
<div class="ttc" id="namespacestd_html"><div class="ttname"><a href="../../d8/dcc/namespacestd.html">std</a></div><div class="ttdef"><b>Definition:</b> quantum_stl_impl.h:23</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1TaskQueue_html_abe66c06fdb34f0dba8863ce115ad9388"><div class="ttname"><a href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#abe66c06fdb34f0dba8863ce115ad9388">Bloomberg::quantum::TaskQueue::tryEnqueue</a></div><div class="ttdeci">bool tryEnqueue(ITask::Ptr task) final</div><div class="ttdef"><b>Definition:</b> quantum_task_queue_impl.h:206</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1TaskQueue_html_a0b0a30fdf109f7b8ec549c194a6a0701"><div class="ttname"><a href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#a0b0a30fdf109f7b8ec549c194a6a0701">Bloomberg::quantum::TaskQueue::run</a></div><div class="ttdeci">void run() final</div><div class="ttdef"><b>Definition:</b> quantum_task_queue_impl.h:76</div></div>
<div class="ttc" id="namespaceSpinLock_html"><div class="ttname"><a href="../../de/df4/namespaceSpinLock.html">SpinLock</a></div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1IQueue_html"><div class="ttname"><a href="../../d2/db0/structBloomberg_1_1quantum_1_1IQueue.html">Bloomberg::quantum::IQueue</a></div><div class="ttdoc">Interface to a task queue. For internal use only.</div><div class="ttdef"><b>Definition:</b> quantum_iqueue.h:33</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1QueueStatistics_html"><div class="ttname"><a href="../../d1/d7b/classBloomberg_1_1quantum_1_1QueueStatistics.html">Bloomberg::quantum::QueueStatistics</a></div><div class="ttdoc">Provides various counters related to queues and task execution.</div><div class="ttdef"><b>Definition:</b> quantum_queue_statistics.h:30</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1TaskQueue_html_aa95412277b5a0324549af806721fd85e"><div class="ttname"><a href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#aa95412277b5a0324549af806721fd85e">Bloomberg::quantum::TaskQueue::isIdle</a></div><div class="ttdeci">bool isIdle() const final</div><div class="ttdef"><b>Definition:</b> quantum_task_queue_impl.h:364</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1TaskQueue_html_a2fab46164ecf8aa2e847f713e0e35cdd"><div class="ttname"><a href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#a2fab46164ecf8aa2e847f713e0e35cdd">Bloomberg::quantum::TaskQueue::stats</a></div><div class="ttdeci">IQueueStatistics &amp; stats() final</div><div class="ttdef"><b>Definition:</b> quantum_task_queue_impl.h:320</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1Configuration_html"><div class="ttname"><a href="../../db/dda/classBloomberg_1_1quantum_1_1Configuration.html">Bloomberg::quantum::Configuration</a></div><div class="ttdef"><b>Definition:</b> quantum_configuration.h:31</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1TaskQueue_html_a45cfdb8a415a15bdcd6e52b26c18f035"><div class="ttname"><a href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#a45cfdb8a415a15bdcd6e52b26c18f035">Bloomberg::quantum::TaskQueue::dequeue</a></div><div class="ttdeci">ITask::Ptr dequeue(std::atomic_bool &amp;hint) final</div><div class="ttdef"><b>Definition:</b> quantum_task_queue_impl.h:247</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1TaskQueue_html"><div class="ttname"><a href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html">Bloomberg::quantum::TaskQueue</a></div><div class="ttdoc">Thread queue for running coroutines.</div><div class="ttdef"><b>Definition:</b> quantum_task_queue.h:45</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1TaskQueue_html_a062eb69d9f40611e0240b17c9c753b95"><div class="ttname"><a href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#a062eb69d9f40611e0240b17c9c753b95">Bloomberg::quantum::TaskQueue::TaskQueue</a></div><div class="ttdeci">TaskQueue()</div><div class="ttdef"><b>Definition:</b> quantum_task_queue_impl.h:26</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1IQueue_html_ab4c4a3db733a93ad451c9dc7ffe62824"><div class="ttname"><a href="../../d2/db0/structBloomberg_1_1quantum_1_1IQueue.html#ab4c4a3db733a93ad451c9dc7ffe62824">Bloomberg::quantum::IQueue::Ptr</a></div><div class="ttdeci">std::shared_ptr&lt; IQueue &gt; Ptr</div><div class="ttdef"><b>Definition:</b> quantum_iqueue.h:36</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1TaskQueue_html_ad2942c9d04b7c1d7eed395ee8186964e"><div class="ttname"><a href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#ad2942c9d04b7c1d7eed395ee8186964e">Bloomberg::quantum::TaskQueue::empty</a></div><div class="ttdeci">bool empty() const final</div><div class="ttdef"><b>Definition:</b> quantum_task_queue_impl.h:293</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1TaskQueue_html_a538a6332f83626076d5850438bbcdcc9"><div class="ttname"><a href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#a538a6332f83626076d5850438bbcdcc9">Bloomberg::quantum::TaskQueue::pinToCore</a></div><div class="ttdeci">void pinToCore(int coreId) final</div><div class="ttdef"><b>Definition:</b> quantum_task_queue_impl.h:59</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1TaskQueue_html_adcb6d84109188e5c6152adbfe004e219"><div class="ttname"><a href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#adcb6d84109188e5c6152adbfe004e219">Bloomberg::quantum::TaskQueue::getLock</a></div><div class="ttdeci">SpinLock &amp; getLock() final</div><div class="ttdef"><b>Definition:</b> quantum_task_queue_impl.h:326</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1TaskQueue_html_ae037a712f1c548a3fe755d3cf165142a"><div class="ttname"><a href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#ae037a712f1c548a3fe755d3cf165142a">Bloomberg::quantum::TaskQueue::signalEmptyCondition</a></div><div class="ttdeci">void signalEmptyCondition(bool value) final</div><div class="ttdef"><b>Definition:</b> quantum_task_queue_impl.h:332</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1TaskQueue_html_abf230e9bdc7bf07033f5afbb7a2f3cc3"><div class="ttname"><a href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#abf230e9bdc7bf07033f5afbb7a2f3cc3">Bloomberg::quantum::TaskQueue::enqueue</a></div><div class="ttdeci">void enqueue(ITask::Ptr task) final</div><div class="ttdef"><b>Definition:</b> quantum_task_queue_impl.h:194</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1IQueueStatistics_html"><div class="ttname"><a href="../../d5/de7/structBloomberg_1_1quantum_1_1IQueueStatistics.html">Bloomberg::quantum::IQueueStatistics</a></div><div class="ttdoc">Interface to access and manipulate a QueueStatistics object.</div><div class="ttdef"><b>Definition:</b> quantum_iqueue_statistics.h:29</div></div>
<div class="ttc" id="structBloomberg_1_1quantum_1_1ITask_html"><div class="ttname"><a href="../../df/daf/structBloomberg_1_1quantum_1_1ITask.html">Bloomberg::quantum::ITask</a></div><div class="ttdoc">Interface to a task. For internal use only.</div><div class="ttdef"><b>Definition:</b> quantum_itask.h:32</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1TaskQueue_html_ae7120fc5642802293e0fff8de45fcfa5"><div class="ttname"><a href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#ae7120fc5642802293e0fff8de45fcfa5">Bloomberg::quantum::TaskQueue::tryDequeue</a></div><div class="ttdeci">ITask::Ptr tryDequeue(std::atomic_bool &amp;hint) final</div><div class="ttdef"><b>Definition:</b> quantum_task_queue_impl.h:255</div></div>
<div class="ttc" id="classBloomberg_1_1quantum_1_1TaskQueue_html_a2cc96b016e5f92f1f6e77f9bd0cb6783"><div class="ttname"><a href="../../d8/d06/classBloomberg_1_1quantum_1_1TaskQueue.html#a2cc96b016e5f92f1f6e77f9bd0cb6783">Bloomberg::quantum::TaskQueue::TaskListIter</a></div><div class="ttdeci">TaskList::iterator TaskListIter</div><div class="ttdef"><b>Definition:</b> quantum_task_queue.h:49</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><b>quantum_task_queue.h</b></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
  </ul>
</div>
</body>
</html>
